import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashSet;
import java.util.LinkedHashSet;
import java.util.LinkedList;
import java.util.Map;
import java.util.TreeSet;

import net.mindview.util.Generator;

public class E04_PrintingContainers {

	private static MovieNameGenerator mng = new MovieNameGenerator();

	static String[] fill(String[] str) {
		for (int i = 0; i < str.length; i++) {
			str[i] = mng.next();
		}
		return str;
	}

	static Collection fill(Collection<String> collection) {
		for (int i = 0; i < 5; i++) {
			collection.add(mng.next());
		}
		return collection;
	}

	static Map fill(Map<String, String> map) {
		for (int i = 0; i < 5; i++) {
			map.put(mng.next(), mng.next());
		}
		return map;
	}

	public static void main(String[] args) {
		System.out.println(Arrays.toString(fill(new String[5])));
		System.out.println(fill(new ArrayList<String>()));
		System.out.println(fill(new LinkedList<String>()));
		System.out.println(fill(new HashSet<String>()));
		System.out.println(fill(new LinkedHashSet<String>()));
		System.out.println(fill(new TreeSet<String>()));
	}

}

class MovieNameGenerator implements Generator<String> {

	String[] characters = { "Grumpy", "Happy", "Sleepy", "Dopey", "Doc",
			"Sneezy", "Bashful", "Snow White", "Witch Queen", "Prince" };
	int next;

	@Override
	public String next() {
		String r = characters[next];
		next = (next + 1) % characters.length;
		return r;
	}

}
